package domain
{
	import mx.binding.utils.BindingUtils;
	

	[Bindable]
	public class BuildResult 
	{
		public var projectName:String;
		public var name:String;
		public var key:String;
		public var state:String;
		public var number:String;
		public var buildTime:String;
		public var xml:XML;
		
		public function BuildResult( xml:XML ){
			this.xml = xml;
		    this.key = xml.buildKey;
			this.name = xml.buildName;
			this.number = xml.buildNumber;
			this.state = xml.buildState;
			this.projectName = xml.projectName;
			this.buildTime = xml.buildTime;
		}
		
		public function get buildId():String {
			return key + '-' + number;
		}
		public function get failure():Boolean {
			return state == "Failed";
		}
		public function get success():Boolean {
			return !failure;
		}
	}
}